﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;

namespace System
{

	public sealed class MethodCaller
	{

		internal MethodCaller( MethodInfo method, object[] parameters )
		{
			this.Method = method;
			this.Parameters = parameters;
		}

		public MethodInfo Method
		{ get; private set; }

		public object[] Parameters
		{ get; private set; }


		public object Of( object instance )
		{
			return this.Method.Invoke( instance, this.Parameters );
		}
	}
}
